package com.zb.serviceImpl;

import com.zb.mapper.AccountMapper;
import com.zb.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: 张波
 * @Time: 2025/8/21 18:55
 */
@Service
public class AccountServiceImpl implements AccountService {
	/**
	 *
	 * @param inId 转入用户Id
	 * @param outId 转出用户Id
	 * @param money 钱数
	 */
	@Autowired
	private AccountMapper accountMapper;
	@Transactional
	@Override
	public void exchangeTwoMoney(int inId, int outId, double money) {
		accountMapper.updateSubMoney(outId,money);
		System.out.println(1/0);
		accountMapper.updateAddMoney(inId,money);
	}
}
